Repository navigation
fix(scenarios): scorer and card defects from the 18.6.0 gallery refresh - #36320
objectstack-fleet[bot] merged 7 commits into
Conversation
… met 428 no_confirmation_service and the confirm turn did not retry Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…ce of two served figures it also writes Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…cided steps on or before asOf, and move TK-0091 off the 30-day boundary Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…ue its Build half grades Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…d path, where no record-triggered flow fires Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…lery refresh Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
📓 Docs Drift Check7 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 17c97b013eab68c5fc529aa18911b7c396e2dbfe && git checkout 17c97b013eab68c5fc529aa18911b7c396e2dbfe
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3f7fdd002130a34ce24f735733c2642538914af9 101b30bb3518941c8c696c6b6e29f0a8974c2489 && git checkout -B drift-repro 3f7fdd002130a34ce24f735733c2642538914af9 && git merge --no-ff 101b30bb3518941c8c696c6b6e29f0a8974c2489
node scripts/docs-audit/affected-docs.mjs --json 3f7fdd002130a34ce24f735733c2642538914af9 |
…ning Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Contract reviewServed-tier: Owed on the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: No must-fix, no should-fix. VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 席位核对L1 verdict: ACCEPT at head
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Landing note: |
…ugh (via) (objectstack-ai#36503) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_ Part of objectstack-ai#36206 (item 3 and the PAY-0044 position land here; the column-total half of item 2 waits on the eval seat's re-score and stays open on the card). Clause-②: yes (widening) Metadata-protocol: none Ruling-ref: 7077801044 (item 3 C, PAY-0044 folded) ## 维护者速读 - 用户能看到什么变化:评测席位跑场景卡时,经理通过卡片自带的审批动作做决定的那一步,搭建分不再因经理没有直接改审批记录的权限而被扣,改记为“未测”;其余用户无感。 - 为什么做:场景库专题(画廊刷新)里请假余额和采购到收货两张卡,搭建正确却被扣分;顺带修正订单到回款卡上一笔付款落在“近 30 天”边界日、导致卡片答案与平台口径不一致的问题。 - 出错会怎样:最坏是某张卡的这一项授权检查被记为“未测”而不是“失败”,只影响评测分数,改动可直接撤回。 - 要你做什么:无。 ## What changes Against `origin/main` 59392ed. | Part | Change | |:--|:--| | Card schema | An operation may carry `via`: the card's own agent action the write is designed to go through. Optional; a card without it reads exactly as before. | | Loader | Refuses a `via` that is not one of the card's `run.agentActions` on the operation's object (the ruled check), and a `via` on a `refused` operation (a refused write has no route; without this the key would be accepted and do nothing). | | Grant grading (`gradePersonaGrants`) | `persona-grant:PERSONA:OBJECT:VERB` is **not measured, never a pass**, when the set withholds the verb AND every operation that needs it has a designed route the build declares: its `via` action, or (unchanged) the card's confirm-gated action for a `pending_confirmation` write. A set that grants the verb still passes. An operation without `via` is graded as today, so one unrouted applied write of the same verb keeps the check measured. The existing confirm-gated branch and its detail text are unchanged; the `no designed route` pin (`start_qa`, non-confirm action, no `via`) stays green. | | Cards | `via: decide_approval_step` on leave_balances `manager_approves_step_one`, requisition_to_receipt `manager_approves_level_one` and travel_expense `manager_approves_step_one`. Not tagged (no measured run yet): asset_lifecycle `manager_approves_scrap`, order_to_cash `approve_discount`. A library pin lists exactly the three tagged operations. | | PAY-0044 | order_to_cash's PAY-0044 moves from 2026-10-01 to 2026-10-02 (bank reference `ACH-1002-058`), the same one-day move PR objectstack-ai#36320 gave TK-0091, and the seed rule names the exception. The library pin of last-N-days truths that change under the platform's preset flips to `[]`. `collected_by_team_last_30_days` west becomes 58300 (was 53500; the payment now falls inside the card's 30-day window too). The only other reader of `payment_date` is the collection-call automation check (paid by due + 15 days), which reads the same for INV-1058 either way. | `Clause-②: yes (widening)` reading: `src/index.ts` does `export * from './schema.js'`, so `OperationSchema` and `ScenarioCardSchema` are on the package's `.` entry (`package.json` `exports["."]` maps to `dist/index.*`); `PersonaGrantNeed` (gains `routedVia`) is on `./score` via `export * from './scenario-tags.js'`. **Read first (by risk):** 1. `packages/qa/scenarios/src/score/scenario-tags.ts`: `designedRoutes` and the new branch at the top of `gradePersonaGrants`'s needed path; the old confirm branch must read unchanged when no operation names `via`. 2. `packages/qa/scenarios/src/loader.ts`: the `via` block in the operations loop. 3. `docs/qa/scenarios/order_to_cash.json`: PAY-0044 row and the seed-rule sentence. **Two-minute check:** `pnpm --filter @objectstack/scenarios exec vitest run test/score/scenario-tags.test.ts test/refusals.test.ts test/library.test.ts`, expect all green, including the new `an applied write the card routes through its own action` case. ## Tests - New `scenario-tags.test.ts` case: with the read-only contractor and `start_qa` routed `via set_task_status`, the update check is not measured with the named detail and counts in neither figure; a granting set still passes; a build without the action keeps it measured (fails); the card without `via` fails as before; a second unrouted update keeps it measured. - Three new `refusals.test.ts` rows: an undeclared action, the card's action on another object, a `via` on a refused write. - `library.test.ts`: the tagged-operations pin; the last-N-days pin flipped to `[]`. - `order-to-cash.test.ts`: the `collected_by_team_last_30_days` truth updated to west 58300. <details><summary>Package suite and typecheck (head bb187ca, merged main)</summary> ```text pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 Test Files 42 passed (42) Tests 1310 passed (1310) os-verify-lock: VERDICT command-exit 0 ``` The package's `typecheck` includes `test/**`. The commit after that one adds only the changeset. </details> <details><summary>Ablations (one-time, restored to HEAD; not left in the tree)</summary> ```text grading: scenario-tags.ts `const via = n.routedVia.filter(...)` -> `const via: string[] = [];` ablation-replace: ok mutation landed: anchor 1 -> 0, blob 7ae784e -> 77cf0c9a74ac x an applied write the card routes through its own action (`via`) ... Tests 1 failed | 101 passed (102) (the confirm-gated / no-designed-route pin stays green) ablation-replace: ok restored: blob == HEAD (7ae784e) and `git diff HEAD` is empty loader: `if (op.via !== undefined) {` -> `if (op.via !== undefined && false) {` ablation-replace: ok mutation landed: anchor 1 -> 0, blob 2d93286 -> 8a1456983646 Tests 3 failed | 118 passed (121) (the three new refusal rows) ablation-replace: ok restored: blob == HEAD (2d93286) and `git diff HEAD` is empty ``` Both subjects resolve from `src/` (relative imports), so no rebuild sat between mutation and run. </details> <details><summary>Derived gate families (head 8eb5896): 68 derived, 66 exit 0, 2 NOT MEASURED</summary> `node scripts/pm/dispatch-gates.mjs --commands` (merge base 59392ed), each run with its exit captured before any pipe, then `--ran` with the codes: "68 derived famil(ies) accounted for — 66 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)". - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: PREREQUISITE NOT MET (reads built output of every package; this worktree built only the scenarios closure). CI's `Lint & Repo Gates` runs it. - NOT MEASURED: `pnpm check:type-check-debt`, reason: its closure build never got a turn on the shared verify lock (queue-timeout, held by another session's dogfood run). The diff touches no tsconfig or typecheck script; the scenarios package typecheck is green above. CI's `Lint & Repo Gates` runs it. - Every other derived family exited 0, including `check:nul-bytes`, `check:cross-package-test-inputs`, `check:published-files`, `check:doc-authoring`, `check:issue-citations` and `check:adr-0087-registration`. - Full dogfood battery: not run (no `!` in the title, no `(narrowing)` arm). </details> ## Acceptance notes - The loader's refusal of `via` on a `refused` operation goes one step past the ruled text (which names only the not-an-action refusal). Reason: grading reads `via` only on writes that need a grant, so on a refused write the key would be accepted and ignored. It is a refusal on a key that is new in this PR; no card writes it. - Not tagged, by the ruling: asset_lifecycle `manager_approves_scrap` (`decide_scrap_request`) and order_to_cash `approve_discount` (`decide_discount_approval`) have the same decide-through-action shape, but no measured run shows the grant check failing there yet. - Item 2b (a decline stating a whole-column total) is not in this PR; it waits on the eval seat's re-score of `september_commission`. ## Verification Item 3 is graded on the next gallery refresh: leave_balances and requisition_to_receipt Build and Iterate should read `persona-grant:dept_manager:approval_step:update` as not measured when the build routes the decision through `decide_approval_step` without granting the update, and as passed when it grants it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…un --template warns on a stale one The verified build's provenance named card sha256 29162eef..., the card before #36320 and #36617; the card file on main hashes to 212abedb... (sha256 of the file's bytes, as the loader stamps it). Since the build was authored only the card's prompt and run sections changed; expect and iterate did not, so the build file and its verified scores stand. run --template F now prints a warning when F.provenance.json names the same card with another cardSha256, and a test pins each committed provenance to its card and build file. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr
Requested by Steve · project thread
Part of #36206 (items 1, 4, 5, 6, 7, 8 and the operand-shown half of item 2 land here; item 3 and the column-total half of item 2 wait on a decision, see Acceptance notes).
Clause-②: yes (widening) — new exports
confirmTurnMetNoConfirmationServiceandSEED_POSTUREon the./runnerentryMetadata-protocol: none
维护者速读
What changes
One commit per item; each conclusion below is against
origin/main4ab1218.428 no_confirmation_serviceconfirmTurnMetNoConfirmationService(src/runner/orchestrate.ts): the confirmed write is not measured when the confirm turn's own write met that 428 (as before) OR the first turn's write met it and the confirm turn sent no write on the object. A confirm turn that does write is graded as any other. PR #36140 (merged for #35907) covered only the first leg: its diff marks not-measured fromwriteCallsOn(second, ...)alone.supportedNumbers(src/score/scenario-run-grade.ts): a number in anunanswerabledecline is supported when it is the sum or difference of two OTHER numbers the reply writes that the turn's outputs carry (54.5 = 45.5 + 9; 229 = 249 - 20). Operands must stand in the reply, one step only, a zero from two equal figures supports nothing. The column-total half ($125,190) is not changed: it contradicts a pinned case in the same suite ("an amount summed from the rows still fails: a sum is not a count"), so it is an open question.persona-grant:dept_manager:*_approval_step:updatevs the card's owndecide_approval_stepconfirm: trueas a designed route; the suite pins the opposite case on purpose ("The card's action withoutconfirmis no designed route: the check is measured", andstart_qastays measured besideset_task_status). Acceptingdecide_approval_stepreverses that pin.supplier.ratingseededA/B/Cgrade_a/grade_b/grade_c(no truth reads the field). New library guard: every seed value of a card'sselectFieldsfield parses as aSelectOptionSchemavalue.as_118_2.decided_onafterasOf2026-11-02to2026-10-31(no truth reads step dates). New library guard: per card, the seed fields dated afterasOfare pinned (all are plans: due, start, end, expected).urgent_high_last_30_daysoff by onelast_30_dayspreset (['30_days_ago', 'tomorrow'),packages/core/src/utils/analytics-date-range.ts) counts and the card's 30-day window does not; truth 8 to 9, seed rule$commentnames the exception. The card'slast_dayssemantics are untouched. New library guard: nolast_daystruth changes when its window is widened by the preset's extra day.dashboards.reportasks for a report in both languages.SEED_POSTUREinsrc/runner/prompts.ts: rows load through the platform's seed path as established facts, no record-triggered flow fires, so a derived field must be a formula or a write-time expression; a loaded row is already counted in stored totals. Seeding behaviour is unchanged.Read first (by risk):
src/score/scenario-run-grade.tssupportedNumbers(the grader widening),src/runner/orchestrate.tsconfirmTurnMetNoConfirmationService,docs/qa/scenarios/service_desk.json(seed move + prompt).Two-minute check:
pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/library.test.tsshows 19 passed, including the four new guards.Tests
test/runner/orchestrate.test.ts(first-turn 428 + no write: not measured; + a write: graded; other-reason 428 + no write: measured fail). Item 2, five cases intest/score/scenario-run-grade.test.ts. Items 4-7, four guards intest/library.test.ts. Item 8, one case intest/runner/units.test.ts. Item 6, the service_desk truth pin 8 to 9.typecheckclean,test42/42 files and 1293 tests passing across two runs (the first run's 14 skips are the two build files' tests, which pass once the package is built) — see Verification.Acceptance notes
appliedwrite too (reverses the pinnedconfirm-only rule); (B) keep the rule, and the leave_balances / requisition_to_receipt prompts tell the build to grant the managerupdateonapproval_step; (C) a card-schema opt-in naming the operation's route action, so only operations the card designs through an action leave the check to the run.collected_by_team_last_30_dayshas PAY-0044 on 2026-10-01. The new guard enumerates it as the one remaining position, so fixing it turns that pin red by design.Verification
Item 1 ablation (orchestrate.ts, fix committed first)
node scripts/ablation-replace.mjs --file packages/qa/scenarios/src/runner/orchestrate.ts --anchor ' || (firstMet && writes.length === 0)' --delete -- ... vitest run test/runner/orchestrate.test.ts -t 'two turns': mutation landed (anchor 1 to 0, blob f58c0772bd62 to c72e3bd35891); the new not-measured case failed (1 failed, 14 passed); restored, blob == HEAD,git diff HEADempty.Item 2 ablation (scenario-run-grade.ts)
First attempt was a no-op refused by the tool (replacement text was a substring of the anchor, rise 0); rerun with
--anchor ' || values.some((n) => derived(n, at))' --delete: mutation landed (blob 9a3cb9e8247e to 78d0020365c7); the sum and difference cases failed (2 failed, 3 passed); restored, blob == HEAD,git diff HEADempty.Items 4-6 reverse verification (base card data)
With the three cards restored from 4ab1218 (tree only),
test/library.test.ts: 3 failed, 15 passed — the select-value guard listed sixsupplier.ratingvalues, the asOf guard and the window guard (service_desk/urgent_high_last_30_days) went red;git checkout HEAD -- docs/qa/scenarios/thengit diff HEADempty and status clean.Package suite and derived gates at c621cbb
pnpm --filter @objectstack/scenarios typecheck: clean.pnpm --filter @objectstack/scenarios test: 40/42 files on the first run, the twotest/build/*files refusing for a missing owndist/; afterpnpm --filter @objectstack/scenarios buildboth pass (2/2 files, 14 tests). Total 42/42 files, 1279 + 14 = 1293 tests passed.node scripts/pm/dispatch-gates.mjs --commandsderived 69 commands; all run, exit codes captured before any pipe;--ranreconciliation: 69 accounted, 67 run, 2 NOT MEASURED (exit 3, prerequisite):check-plugin-teardown-shape.mjs --self-test(positive control pinned to a commit this shallow checkout cannot reach) andcheck:dual-build-cjs-loads(needs every package'sdist/). Both are left to CI.test:repoand the full lint farm are CI's.Generated by Claude Code